package neurones;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		int[] nb_neurones = {3, 5, 1};
		double[] input = new double[3];
		double[] output;
		double[] expected = new double[1];
		Reseau r = new Reseau(nb_neurones);
		r.randomize();
		
		for(int j = 0; j < 500; j++)
		{
		for(double i = -1; i < 1; i += 0.001)
		{
			input[0] = Math.sin(i);
			input[1] = Math.cos(i);
			input[2] = i;
			r.setInput(input);
			output = r.getOutput();
			expected[0] = i*i;
			r.learn(expected);
			
		}
		}
		
		for(double i = -1; i < 1; i += 0.001)
		{
			input[0] = Math.sin(i);
			input[1] = Math.cos(i);
			input[2] = i;
			r.setInput(input);
			output = r.getOutput();
			expected[0] = i*i;
			
			System.out.println(output[0] + " : " + expected[0]);
		}
		

	}

}
